<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="common/include :: header('选材订餐列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="customer-form">
                <div class="select-list">
                    <ul>
                        <li>
                            关键字：<input type="text" name="keyword" placeholder="模糊查询菜肴名称"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body" style="text-align:center;">
                <img id="imageSrc" src="" alt="" width="300px" height="auto">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<th:block th:include="common/include :: footer"/>
<script th:inline="javascript">

    var removeFlag = [[${@permission.hasPermi('business:ingredientBook:remove')}]];
    var prefix = ctx + "/business/ingredientBook";
    $(function () {
        var options = {
            url: prefix + "/query",
            removeUrl: prefix + "/remove",
            uniqueId: 'id',
            modalName: "选材订餐",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'goodsName',
                    title: '菜肴名称'
                },
                {
                    field: 'taste',
                    title: '菜肴口味'
                },
                {
                    field: 'ingredientName',
                    title: '所需食材'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'insertTime',
                    title: '创建时间'
                },
                {
                    field: 'bookUsername',
                    title: '预订用户'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var removeFlagTemp = removeFlag;

                        var actions = [];
                        actions.push("<a class='btn btn-danger btn-xs " + removeFlagTemp + "' href='javascript:void(0)' onclick='$.operate.remove(" + row.id + ")'><i class='fa fa-remove'></i>删除</a>");
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>